package com.design.mode.mediator;

import lombok.Data;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-12 10:15:03
 */
@Data
public class ConMediator implements Mediator {

    private Colleague1 colleague1;
    private Colleague2 colleague2;

    @Override
    public void colleagueChanged(Colleague c) {
        colleague1.action();
        colleague2.action();
    }

    public void create() {
        colleague1 = new Colleague1(this);
        colleague2 = new Colleague2(this);
    }

}
